package com.example.consume;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.util.Date;

@Slf4j
@Component
public class DelayedQueueConsumer {

    @RabbitListener(queues = "delayed.queue")
    public void plugins(Message message) {
        log.info("当前时间{}，消费消息体{}。", new Date().toString(), new String(message.getBody()));
    }

}
